#include "client/windows/handler/exception_handler.h"
#include <tchar.h>

const size_t kMaximumLineLength = 256;

using namespace google_breakpad;

#pragma  comment(lib, "exception_handlerD.lib")
#pragma  comment(lib, "commonD.lib")
#pragma  comment(lib, "crash_generation_clientD.lib")

#if 1
bool ShowDumpResults(const wchar_t* dump_path,
					 const wchar_t* minidump_id,
					 void* context,
					 EXCEPTION_POINTERS* exinfo,
					 MDRawAssertionInfo* assertion,
					 bool succeeded) {
	printf("Print after dump!\n");

	return succeeded;
}
#endif

ExceptionHandler* handler = NULL;

void Test(void)
{
	int *p = NULL;
	*p = 28238;
}

int main()
{
	handler = new ExceptionHandler(
		L"D:\\dumps\\", 
		NULL, 
		ShowDumpResults,//NULL, 
		NULL, 
		ExceptionHandler::HANDLER_ALL, 
		MiniDumpNormal, 
		NULL, 
		NULL
		);

#if 0
	int n = -1;
	n++;
	int m = 3/n;

	int *p = NULL;
	*p = 2839;
#else
	Test();
#endif

	return 0;
}